package com.pri.chat.adapter;

import android.view.View;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.netease.nim.uikit.net.entity.RechargeBondBean;
import com.pri.chat.R;

import java.util.List;

/**
 * 描述：添加类的描述
 *
 * @author wx5e48d604c2885118
 * @time 2020/4/24
 */
public class RechargeVIPAdapter extends BaseQuickAdapter<RechargeBondBean, BaseViewHolder> {
    public RechargeVIPAdapter(int layoutResId, @Nullable List<RechargeBondBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RechargeBondBean item) {
        TextView monthTv = helper.getView(R.id.monthTv);
        monthTv.setText(item.getVipMonth()+"个月");
        TextView priceTv = helper.getView(R.id.priceTv);
        priceTv.setText("¥"+item.getMoney() + "元");
        ImageView imageView = helper.getView(R.id.monthImg);
        View monthRelation = helper.getView(R.id.monthRelation);
        if (item.isCheck()) {
            imageView.setVisibility(View.VISIBLE);
            monthRelation.setBackgroundResource(R.drawable.btn_orange_noconer_line_shape);
            monthTv.setTextColor(mContext.getResources().getColor(R.color.orange));
            priceTv.setTextColor(mContext.getResources().getColor(R.color.orange));
        } else {
            imageView.setVisibility(View.GONE);
            monthRelation.setBackgroundResource(R.drawable.btn_gray_noconer_line_shape);
            monthTv.setTextColor(mContext.getResources().getColor(R.color.color_666666));
            priceTv.setTextColor(mContext.getResources().getColor(R.color.color_666666));
        }
    }
}
